<?PHP
class ScriptManager
{
    private $path = ".";
    
    private function WriteScript($file)
    {
        $localPath = "{$this->path}/$file";
        $hf = fopen($localPath, 'r');
        
        if ( 0 == $hf )
        {
            die ("//file doesn't exist");
        }
        
        $jsscript = fread($hf, filesize($localPath));
        
        echo $jsscript;
    }
    
    static function main($args)
    {
        $sm = new ScriptManager();
        
        if ( array_key_exists('file', $args) )
        {
            $sm->WriteScript($args['file']);
        }
        else
        {
            echo "// incorrect parameters has passed";
        }
    }
}

ScriptManager::main($_REQUEST);
?>
